package com.kelvin.manage.mapper;

import com.kelvin.manage.model.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {
    @Insert("insert into student(user_id) VALUES(#{user_id})")
    public int insertStudent(Student student);

    @Delete("delete from student where id=#{student_id}")
    public int deleteStudent(long studentId);

    @Update("update student set name = #{name}, sex = #{sex}, age = #{age},birthday = #{birthday},class_name = #{class_name} WHERE id = #{id}")
    public int updateStudent(Student student);

    @Select("select * from student")
    public List<Student> getAllStudent();

    @Select("select * from student where id=#{id}")
    public Student getStudentById(@Param("id")long id);
}
